package com.lenovo.spider.process.exceptions;

import lombok.extern.slf4j.Slf4j;

/**
 * @author <a href="mailto:liuhan3@lenovo.com">HanL(liuhan3)</a>
 * on 2018/3/27 15:10
 */
@Slf4j
public class DefaultExceptionHandler extends ExceptionHandler {

    /**
     * 处理所有的
     *
     * @param throwable
     * @return
     */
    @Override
    boolean support(Throwable throwable) {
        return throwable instanceof RuntimeException;
    }

    @Override
    boolean handle(Throwable throwable) {
        log.error(throwable.getMessage(), throwable);
        return true;
    }

    /**
     * @return
     */
    @Override
    int getOrder() {
        return Integer.MAX_VALUE;
    }
}
